@extends('admin::layouts.master')

@section('content')
    {{--<h1>Hello World</h1>--}}

    {{--<p>--}}
        {{--This view is loaded from module: {!! config('admin.name') !!}--}}
    {{--</p>--}}


    <div class="container">
        <div class="card">
            <div class="card-header">
                <ul class="nav nav-tabs" role="tablist">
                    <li class="active">用户列表</li>&nbsp;&nbsp;&nbsp;&nbsp;
                    <li ><a href="{{route('admin.create')}}">添加用户</a></li>
                </ul>
            </div>
            <div class="card-body">
                <table class="table">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>用户</th>
                        <th>邮箱</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($userdate as $v)
                    <tr>
                        <td scope="row">{{$v['id']}}</td>
                        <td>{{$v['name']}}</td>
                        <td>{{$v['email']}}</td>
                        <td>
                            <div class="btn-group" role="group" aria-label="Basic example">
                                <button type="button" class="btn btn-info">查看</button>
                                <a href="{{route('admin.edit',$v['id'])}}" class="btn btn-success">编辑</a>
                                <form action="{{route('admin.destroy',$v['id'])}}" method="post">
                                    @csrf
                                    @method('DELETE')
                                    <button type="submit" class="btn btn-danger">删除</button>
                                </form>

                            </div>
                        </td>
                    </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
            <div class="card-footer text-muted">
                {{$userdate->links()}}
            </div>
        </div>
    </div>
@stop
